#include "main.h"
#include "resource.h"

#include <vnnv/unichar/vnnv_charsets_filter.h>
unsigned char __g__charsets_table[0xffff];
BOOL mod_cvs_init(HMODULE hins)
{
	HRSRC hrsc;
	wchar_t* lptemp;

	vn_charsets_set(0,0,0xff);

	//1
	hrsc =  FindResource(hins,MAKEINTRESOURCE(IDR_TAB_GB23121),L"TAB");
	if(hrsc)
	{
		if( !(lptemp = (wchar_t*) LoadResource(hins , hrsc)) )
			return 0;
		vn_charsets_set(lptemp,SizeofResource(hins,hrsc),CS_STYLEY_GB6763_1);
	}	
	//2
	hrsc =  FindResource(hins,MAKEINTRESOURCE(IDR_TAB_GB23122),L"TAB");
	if(hrsc)
	{
		if( !(lptemp = (wchar_t*) LoadResource(hins , hrsc)) )
			return 0;
		vn_charsets_set(lptemp,SizeofResource(hins,hrsc),CS_STYLEY_GB6763_2);
	}
	//3
	hrsc =  FindResource(hins,MAKEINTRESOURCE(IDR_TAB_BIG51),L"TAB");
	if(hrsc)
	{
		if( !(lptemp = (wchar_t*) LoadResource(hins , hrsc)) )
			return 0;
		vn_charsets_set(lptemp,SizeofResource(hins,hrsc),CS_STYLEY_BIG5);
	}
	//4
	hrsc =  FindResource(hins,MAKEINTRESOURCE(IDR_TAB_BIG52),L"TAB");
	if(hrsc)
	{
		if( !(lptemp = (wchar_t*) LoadResource(hins , hrsc)) )
			return 0;
		vn_charsets_set(lptemp,SizeofResource(hins,hrsc),CS_STYLEY_BIG5);
	}
	//5
	hrsc =  FindResource(hins,MAKEINTRESOURCE(IDR_TAB_GBK20902),L"TAB");
	if(hrsc)
	{
		if( !(lptemp = (wchar_t*) LoadResource(hins , hrsc)) )
			return 0;
		vn_charsets_set(lptemp,SizeofResource(hins,hrsc),CS_STYLEY_GBK20902);
	}
	return TRUE;
}
